home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / dsp / dspgroup / grep.arc / MORE.DOC < prev    next >
Encoding:
Text File  |  1987-09-10  |  12.2 KB  |  245 lines

  1. LESS(l)
  2.  
  3. NAME
  4.      less - opposite of more
  5.  
  6. SYNOPSIS
  7.                               n         n     n    cmd   name
  8.      less [-cdepstwmMqQuU] [-h_] [-b[fp]_] [-x_] [+___] [____] ...
  9.  
  10. DESCRIPTION
  11.      Less                         more
  12.      ____ is a program similar to ____ (1), but which allows backwards
  13.                                                               less
  14.      movement in the file as well as forward movement.  Also, ____ does not
  15.      have to read the entire input file before starting, so with large
  16.                                                             vi       Less
  17.      input files it starts up faster than text editors like __ (1).  ____
  18.      uses termcap, so it can run on a variety of terminals.  There is even
  19.      limited support for hardcopy terminals.  (On a hardcopy terminal,
  20.      lines which should be printed at the top of the screen are prefixed
  21.      with an up-arrow.)
  22.  
  23.                                 more     vi
  24.      Commands are based on both ____ and __. Commands may be preceeded by a
  25.      decimal number, called N in the descriptions below.  The number is
  26.      used by some commands, as indicated.
  27.  
  28.  
  29. COMMANDS
  30.      h    Help: display a summary of these commands.  If you forget all the
  31.           other commands, remember this one.
  32.  
  33.      SPACE
  34.           Scroll forward N lines, default one screen.  If N is more than
  35.           the screen size, only one screenful is displayed.
  36.  
  37.      f    Same as SPACE.
  38.  
  39.      b    Scroll backward N lines, default one screen.  If N is more than
  40.           the screen size, only one screenful is displayed.
  41.  
  42.      RETURN
  43.           Scroll forward N lines, default 1.  If N is more than the screen
  44.           size, the entire N lines are displayed.
  45.  
  46.      e    Same as RETURN.
  47.  
  48.      j    Also the same as RETURN.
  49.  
  50.      y    Scroll backward N lines, default 1.  If N is more than the screen
  51.           size, the entire N lines are displayed.
  52.  
  53.      k    Same as y.
  54.  
  55.      d    Scroll forward N lines, default 10.  If N is specified, it
  56.           becomes the new default for all d and u commands.
  57.  
  58.      u    Scroll backward N lines, default 10.  If N is specified, it
  59.           becomes the new default for all d and u commands.
  60.  
  61.      r    Repaint the screen.
  62.  
  63.      R    Repaint the screen, discarding any buffered input.  Useful if the
  64.           file is changing while it is being viewed.
  65.  
  66.      g    Go to line N in the file, default 1 (beginning of file).
  67.           (Warning: this may be slow if N is large.)
  68.  
  69.      G    Go to line N in the file, default the end of the file.  (Warning:
  70.           this may be slow if standard input, rather than a file, is being
  71.           read.)
  72.      p    Go to a position N percent into the file.  N should be between 0
  73.           and 100.  (This is possible if standard input is being read, but
  74.                   less
  75.           only if ____ has already read to the end of the file.  It is
  76.           always fast, but not always useful.)
  77.  
  78.      %    Same as p.
  79.  
  80.      m    Followed by any lowercase letter, marks the current position with
  81.           that letter.
  82.  
  83.      '    Followed by any lowercase letter, returns to the position which
  84.           was previously marked with that letter.  All marks are lost when
  85.           a new file is examined.
  86.  
  87.      /pattern
  88.           Search forward in the file for the N-th occurence of the pattern.
  89.           N defaults to 1.  The pattern is a regular expression, as
  90.                         ed
  91.           recognized by __. The search starts at the second line displayed
  92.           (but see the -t option, which changes this).
  93.  
  94.      ?pattern
  95.           Search backward in the file for the N-th occurence of the
  96.           pattern.  The search starts at the line immediately before the
  97.           top line displayed.
  98.  
  99.      n    Repeat previous search, for N-th occurence of the last pattern.
  100.  
  101.      E    Examine a new file.  If the filename is missing, the "current"
  102.           file (see the N and P commands below) from the list of files in
  103.           the command line is re-examined.
  104.  
  105.      N    Examine the next file (from the list of files given in the
  106.           command line).  If a number N is specified (not to be confused
  107.           with the command N), the N-th next file is examined.
  108.  
  109.      P    Examine the previous file.  If a number N is specified, the N-th
  110.           previous file is examined.
  111.  
  112.      =    Prints the name of the file being viewed and the byte offset of
  113.           the bottom line being displayed.  If possible, it also prints the
  114.           length of the file and the percent of the file above the last
  115.           displayed line.
  116.  
  117.      -    Followed by one of the command line option letters (see below),
  118.           this will toggle the setting of that option and print a message
  119.           describing the new setting.
  120.  
  121.                                        less
  122.      V    Prints the version number of ____ being run.
  123.  
  124.                 less
  125.      q    Exits ____.
  126.  
  127.      The following two commands may or may not be valid, depending on your
  128.      particular installation.
  129.  
  130.      v    Invokes an editor to edit the current file being viewed.  The
  131.           editor is taken from the environment variable EDITOR, or defaults
  132.           to "vi".
  133.  
  134.      ! shell-command
  135.           Invokes a shell to run the shell-command given.
  136.  
  137. OPTIONS
  138.      Command line options are described below.  Options are also taken from
  139.      the environment variable "LESS".  (The environment variable is parsed
  140.      before the command line, so command line options override the LESS
  141.                                                          less
  142.      environment variable.  Options may be changed while ____ is running
  143.      via the "-" command.) For example, if you like more-style prompting,
  144.                                              less
  145.      to avoid typing "less -m ..." each time ____ is invoked, you might
  146.           csh
  147.      tell ___:
  148.  
  149.      setenv LESS m
  150.  
  151.                    sh
  152.      or if you use __:
  153.  
  154.      LESS=m; export LESS
  155.  
  156.      -s   The -s flag causes consecutive blank lines to be squeezed into a
  157.                                                           nroff
  158.           single blank line.  This is useful when viewing _____ output.
  159.  
  160.      -t   Normally, forward searches start just after the top displayed
  161.           line (that is, at the second displayed line).  Thus forward
  162.           searches include the currently displayed screen.  The -t command
  163.           line option causes forward searches to start just after the
  164.           bottom line displayed, thus skipping the currently displayed
  165.           screen.
  166.  
  167.                     less
  168.      -m   Normally, ____ prompts with a colon.  The -m command line option
  169.                  less                          more
  170.           causes ____ to prompt verbosely like ____, printing the file name
  171.           and percent into the file.
  172.  
  173.                                             less
  174.      -M   The -M command line option causes ____ to prompt even more
  175.                          more
  176.           verbosely than ____.
  177.  
  178.      -q   Normally, if an attempt is made to scroll past the end of the
  179.           file or before the beginning of the file, the terminal bell is
  180.           rung to indicate this fact.  The -q command line option tells
  181.           less
  182.           ____ not to ring the bell at such times.  If the terminal has a
  183.           "visual bell", it is used instead.
  184.  
  185.                                less
  186.      -Q   Even if -q is given, ____ will ring the bell on certain other
  187.           errors, such as typing an invalid character.  The -Q command line
  188.                        less
  189.           option tells ____ to be quiet all the time; that is, never ring
  190.           the terminal bell.  If the terminal has a "visual bell", it is
  191.           used instead.
  192.  
  193.      -e   Normally the only way to exit less is via the "q" command.  The
  194.           -e command line option tells less to automatically exit the
  195.           second time it reaches end-of-file.
  196.  
  197.      -u   If the -u command line option is given, backspaces are treated as
  198.           printable characters; that is, they are sent to the terminal when
  199.           they appear in the input.
  200.  
  201.      -U   If the -U command line option is given, backspaces are printed as
  202.           the two character sequence "^H".  If neither -u nor -U is given,
  203.           backspaces which appear adjacent to an underscore character are
  204.           treated specially: the underlined text is displayed using the
  205.           terminal's hardware underlining capability.
  206.  
  207.                     less
  208.      -w   Normally, ____ uses a tilde character to represent lines past the
  209.           end of the file.  The -w option causes blank lines to be used
  210.           instead.
  211.  
  212.                     less
  213.      -d   Normally, ____ will complain if the terminal is dumb; that is,
  214.           lacks some important capability, such as the ability to clear the
  215.           screen or scroll backwards.  The -d flag suppresses this
  216.           complaint (but does not otherwise change the behavior of the
  217.           program on a dumb terminal).
  218.  
  219.                     less
  220.      -p   Normally, ____ will repaint the screen by scrolling from the
  221.                                                              less
  222.           bottom of the screen.  If the -p flag is set, when ____ needs to
  223.           change the entire display, it will clear the screen and paint
  224.           from the top line down.
  225.  
  226.                     less
  227.      -h   Normally, ____ will scroll backwards when backwards movement is
  228.           necessary.  The -h option specifies a maximum number of lines to
  229.           scroll backwards.  If it is necessary to move backwards more than
  230.           this many lines, the screen is repainted in a forward direction.
  231.           (If the terminal does not have the ability to scroll backwards,
  232.           -h0 is implied.)
  233.  
  234.                 n                                          n
  235.      -x   The -x_ command line option sets tab stops every _ positions.
  236.                           n
  237.           The default for _ is 8.
  238.  
  239.                 n                           less
  240.      -b   The -b_ command line option tells ____ to use a non-standard
  241.           buffer size.  There are two standard (default) buffer sizes, one
  242.           is used when a file is being read and the other when a pipe
  243.           (standard input) is being read.  The current defaults are 5
  244.           buffers for files and 12 for pipes.  (Buffers are 1024 bytes.)
  245.                      n
  246.           The number _ specifies a different number of buffers to use.  The
  247.           -b may be followed by "f", in which case only the file default is
  248.           changed, or by "p" in which case only the pipe default is
  249.           changed.  Otherwise, both are changed.
  250.  
  251.                                          less
  252.      -c   Normally, when data is read by ____, it is scanned to ensure that
  253.           bit 7 (the high order bit) is turned off in each byte read, and
  254.           to ensure that there are no null (zero) bytes in the data (null
  255.           bytes are turned into "@" characters).  If the data is known to
  256.                                                            less
  257.           be "clean", the -c command line option will tell ____ to skip
  258.           this checking, causing an imperceptible speed improvement.
  259.           (However, if the data is not "clean", unpredicatable results may
  260.           occur.)
  261.  
  262.      +    If a command line option begins with +, the remainder of that
  263.                                                       less
  264.           option is taken to be an initial command to ____. For example, +G
  265.                 less
  266.           tells ____ to start at the end of the file rather than the
  267.           beginning, and +/xyz tells it to start at the first occurence of
  268.           "xyz" in the file.  As a special case, +<number> acts like
  269.           +<number>g; that is, it starts the display at the specified line
  270.           number (however, see the caveat under the "g" command above).  If
  271.           the option starts with ++, the initial command applies to every
  272.           file being viewed, not just the first one.
  273.  
  274.  
  275. BUGS
  276.      When used on standard input (rather than a file), you can move
  277.      backwards only a finite amount, corresponding to that portion of the
  278.      file which is still buffered.
  279.